package beans.saomiao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

public class Main {
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("application-saomiao.xml");
		Test test = (Test)context.getBean("test"); //这里的名字默认和类名一样 且开头小写
		System.out.println(test);
		
		UserController controller = (UserController)context.getBean("userController");
		System.out.println(controller);
		controller.serviceLog();
		
		UserRespositoryImp respositoryImp = (UserRespositoryImp)context.getBean("respositoryImp"); //这里通过value制定了名字为respositoryImp
		System.out.println(respositoryImp);
		
		UserService service = (UserService)context.getBean("userService");
		System.out.println(service);
	}
}
